< previous page page_696 next page >

Page 696
Type.gifListing 18.3. Coding the cmdBtn_Click event.
Private Sub cmdBtn_Click(Index As Integer)
    '
    ' handle button selections
    '
    Select Case Index
        Case 0 ' add
            MSRDC1.Resultset.AddNew
        Case 1 ' delete
            MSRDC1.Resultset.Delete
        Case 2 ' update
            MSRDC1.UpdateRow
        Case 3 ' refresh
            MSRDC1.UpdateControls
        Case 4 ' close
            Unload Me
    End Select
    '
End Sub
Listing 18.4 shows the code you need to add to the four RDC-related events. Note that all four of these routines use a PostMsg subroutine and that the Validate event calls a ShowAction function. You build these routines in the next step of the project.
Type.gifListing 18.4. Coding the events of the RDC.
Private Sub MSRDC1_Error(ByVal Number As Long, Description As String, ByVal
arrow.gifScode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal
arrow.gifHelpContext As Long, CancelDisplay As Boolean)
    '
    PostMsg "MSRDC1_Error - Number=" & CStr(Number) & ", Description = " &
arrow.gifDescription & ", Scode = " & CStr(Scode) & ", Source = " & Source & ",
arrow.gifHelpFile = " & HelpFile & ", HelpContext = " & CStr(HelpContext) & ",
arrow.gifCancelDisplay = " & CStr(CancelDisplay)
    '
End Sub

Private Sub MSRDC1_QueryCompleted()
    '
    PostMsg "MSRDC1_QueryCompleted"
    '
End Sub

Private Sub MSRDC1_Reposition()
    '
    PostMsg "MSRDC1_Reposition"
    '
End Sub

Private Sub MSRDC1_Validate(Action As Integer, Reserved As Integer)
    '

 
< previous page page_696 next page >

If you like this book, buy it!